#!/bin/sh

set -e

# dynamic_sparse_vector_navier_unit and shadow_dynamic_sparse_vector_navier_unit
# are currently broken

run_program() {
    echo $METAPHYSICL_RUN ./$1_unit $METAPHYSICL_OPTIONS
    $METAPHYSICL_RUN ./$1_unit $METAPHYSICL_OPTIONS
    }


for prog in avoid_spurious_fpe compare_types complex_derivs derivs divgrad \
    dynamic_sparse_vector_pde identities instantiations main \
    nd_derivs parallel pde shadow_dynamic_sparse_vector_pde \
    shadow_sparse_struct_pde \
    shadow_sparse_vector_navier shadow_sparse_vector_pde shadow_vector_navier \
    shadow_vector_pde sparse_derivs sparse_identities \
    sparse_struct_pde sparse_vector_navier sparse_vector_pde testheaders testopt \
    vector_navier vector_pde dynamic_std_array_wrapper dynamic_sparse_number_base \
    ct_types \
#    shadow_sparse_struct_navier sparse_struct_navier # these have FPE issues?
do
    run_program $prog
done

if test x${TEST_CXX11} = xyes; then
    run_program physics
fi
if test x${TEST_CXX14} = xyes; then
    run_program dualnamedarray
    run_program namedindexarray
fi
